package com.uinnova.springboot.swagger;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
/*
*@author 王刚
*@data  2019-01-13 17:18
*
*/
@Data
//描述一个model的信息
@ApiModel
public class Swagger {

    private static final long serialVersionUID = 6324749234920325532L;

    @ApiModelProperty(name ="id",value = "主键标识",notes = "数据库主键说明",dataType = "String",required = true,position = 1,hidden = false,example = "123321")
    @NotBlank(message = "id不能为空")
    private String id;

    @ApiModelProperty(name = "name",value = "姓名",notes = "显示名称",dataType = "String",required = true,position = 2,hidden = false,example = "wanggang")
    @NotBlank(message = "name不能为空")
    @Length(min = 1,max = 12,message = "name长度为[1,12]")
    private String name;

    @ApiModelProperty(name ="sex",value = "性别",notes="显示姓名",dataType = "String", required = true,position = 3,hidden = false,allowableValues = "男,女",example = "男")
    private String sex;

    @ApiModelProperty(name = "age",value="年龄",notes = "显示年龄",dataType = "Integer",required = true,position = 4,hidden = false,allowableValues = "range[0,125]",example = "22")
    private Integer age;

    @ApiModelProperty(name = "money",value ="存款",notes = "显示存款",dataType = "String",required = true,position = 5,hidden = false,example = "132300000")
    private String money;

//    @NotBlank(message = "日期不能为空")
    private String time;

    @ApiModelProperty(name = "hobby",value = "爱好",notes = "个人爱好",dataType = "String",required = true,position = 6,hidden = false,example = "篮球")
    private String hobby;
}
